package com.lynn.salary.entity;

import java.util.Date;

public class Article extends BaseEntity {
	/**
	 * 文章状态
	 * */
	public static final String DRAFT = "草稿;";
	public static final String PUBLISH = "发布;";

	private String id;
	private String title;
	private Date createTime;
	private String type;
	private String author;// 作者 关联人员id
	private String content;// 新闻内容 存储富文本
	private String tag = DRAFT;// 文章状态
	private int isDeleted = 0;// 是否被删除 -1为删除 0为未删除 默认为0 未删除

	/**
	 * 获取所有字段
	 * 
	 * @return
	 */
	public static String[] getFields() {

		return new String[] { "id", "title", "createTime", "type", "author", "content", "tag", "isDeleted" };
	}

	/**
	 * 获取表名
	 * 
	 * @return
	 */
	public static String getTableName() {

		return "article";
	}

	/**
	 * 获取主键名字
	 * 
	 * @return
	 */
	public static String getPkName() {

		return "id";
	}

	public static Object[] getFk(String field) {
		if (field.equals("author")) {
			return new Object[] { User_.class, "id" };
		} else if (field.equals("type")) {
			return new Object[] { ArticleType.class, "id" };
		}
		return null;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(int isDeleted) {
		this.isDeleted = isDeleted;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

}
